raar.gui
Class RAGui

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by guitools.DockReceiver
                          extended by raar.gui.RAGui
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class RAGui
extends DockReceiver

Simulator GUI.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static boolean AUTO_REWIND
          Rewind automatically?
 javax.swing.JMenuItem configurePlugins
          Ugly yet efficient public menu for en- and disabling easily.
 RAGDebugFrame debugger
          Some things to remember... and some things to access from outside myself...
static boolean DRAW_LOGO
          Draw logo?
 RAGEdit editor
          Some things to remember... and some things to access from outside myself...
static int eh
          Editor default size.
static int ew
          Editor default size.
 RAGExternalFrame external
          Some things to remember... and some things to access from outside myself...
 javax.swing.JMenuItem externalAgent
          Ugly yet efficient public menu for en- and disabling easily.
static int fh
          Some sizes.
static int fw
          Some sizes.
static javax.swing.ImageIcon icon
          Some icons.
static java.io.File lastPath
          Remember the last path (very non Microsoft, I know).
static javax.swing.ImageIcon logo
          Some icons.
static int margin
          Some sizes.
static int min_h
          Some sizes.
static int min_w
          Some sizes.
 javax.swing.JMenuItem placeAgent
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem removeAgent
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem removeAgentW
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem saveAgent
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenu selAgent
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenu sim_menu
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem sim_play
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem sim_stop
          Ugly yet efficient public menu for en- and disabling easily.
 RAGSimFrame simulator
          Some things to remember... and some things to access from outside myself...
 RAGTasks tasks
          Some things to remember... and some things to access from outside myself...
static java.lang.String title
          Title.
 javax.swing.JMenuItem world_edit_map
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem world_load_map
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem world_load_world
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem world_new_map
          Ugly yet efficient public menu for en- and disabling easily.
 javax.swing.JMenuItem world_save_world
          Ugly yet efficient public menu for en- and disabling easily.
 RAGWorldEdit worldeditor
          Some things to remember... and some things to access from outside myself...
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RAGui()
          Constructor.
 
Method Summary
 void about()
          Show some help.
 void addAgentToWorld(RAAgent agent, java.awt.geom.Point2D.Double position, double rotation)
          Add agent to world.
 boolean agentIsInWorld(RAAgent a)
          Is the agent specified in the world or not?
 void close()
          Close neatly.
 void configurePlugins()
          Show plugin config.
 void debug(java.lang.Object toDebug)
          Debug/show the object provided.
 void determineSafeMode()
          Adapt interface in case of unsafe mode.
 void editAgent(RAAgent aa)
          Edit agent.
 void editMap()
          Edit a map.
 void externalAgent(RAAgent a)
          Add agent to the External Agents controls.
 void generalSettings()
          General settings.
static RAGui getCurrentGui()
          Return current GUI instance.
 javax.swing.JPanel getDockArea()
          Get the dock area.
 javax.swing.JPanel getDockPanel()
          Get the dock panel.
 java.util.Vector getWorldAgents()
          Get the agents that are in the world.
 void help()
          Show some help.
static void hideStarters()
          Hide the logo after startup.
 boolean isExternalEnabled()
          Is external enabled?
 boolean isSimulatorEnabled()
          Is simulator enabled?
 void loadAgent()
          Load agent.
 boolean loadMap()
          Load a map.
 boolean loadMap(java.io.File f, boolean setLastPath)
          Load a map.
 void loadWorld()
          Load a world.
 void loadWorld(java.io.File f)
          Load a world from a file.
 void newAgent()
          New agent.
 void newAgent(RAAgent a)
          New agent.
 void newMap()
          New map.
 void notifyAgentListChanged()
          Notify that agent list has changed.
 void notifyExternalAgentFrameClosed()
          Notify that the external agent frame has been closed.
 void notifySimFrameClosed()
          Notify that the simulator has been closed.
 void place(RAAgent a)
          Add agent to world (command).
 void refreshPlugins()
          Refresh all plug-ins in potentially open windows.
 void removeAgentCompletely(RAAgent a)
          Remove agent.
 void removeAgentFromWorld(RAAgent a)
          Remove agent.
 void renameAgent(RAAgent aa)
          Rename agent.
 boolean safeMode()
          Is the program in safe mode, i.e. is there something running or not?
 void saveAgent(RAAgent a)
          Save agent.
 void saveWorld()
          Save a world.
 void saveWorld(java.io.File f)
          Save a world to a file.
 void setExternalEnabled(boolean enabled)
          Ensure correct external enable/disable status.
 void setSimulatorEnabled(boolean enabled)
          Ensure correct simulator enable/disable status.
 void showDebug()
          Show a debug and monitor window.
static void showStarters()
          Show the logo during startup.
static java.io.File stripFileName(java.io.File f)
          New 1.2 fix for bug that last folder accessed is no longer remembered if we store a file instead of a directory.
 void updateMap(java.lang.String worldDescription)
          Update a world.
 
Methods inherited from class guitools.DockReceiver
dock, docked, undock
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

lastPath

public static java.io.File lastPath
Remember the last path (very non Microsoft, I know).


AUTO_REWIND

public static boolean AUTO_REWIND
Rewind automatically?


DRAW_LOGO

public static boolean DRAW_LOGO
Draw logo?


ew

public static final int ew
Editor default size.

See Also:
Constant Field Values

eh

public static final int eh
Editor default size.

See Also:
Constant Field Values

margin

public static int margin
Some sizes.


fw

public static int fw
Some sizes.


fh

public static int fh
Some sizes.


min_w

public static int min_w
Some sizes.


min_h

public static int min_h
Some sizes.


logo

public static javax.swing.ImageIcon logo
Some icons.


icon

public static javax.swing.ImageIcon icon
Some icons.


title

public static java.lang.String title
Title.


tasks

public RAGTasks tasks
Some things to remember... and some things to access from outside myself...


editor

public RAGEdit editor
Some things to remember... and some things to access from outside myself...


worldeditor

public RAGWorldEdit worldeditor
Some things to remember... and some things to access from outside myself...


simulator

public RAGSimFrame simulator
Some things to remember... and some things to access from outside myself...


external

public RAGExternalFrame external
Some things to remember... and some things to access from outside myself...


debugger

public RAGDebugFrame debugger
Some things to remember... and some things to access from outside myself...


configurePlugins

public javax.swing.JMenuItem configurePlugins
Ugly yet efficient public menu for en- and disabling easily.


selAgent

public javax.swing.JMenu selAgent
Ugly yet efficient public menu for en- and disabling easily.


saveAgent

public javax.swing.JMenuItem saveAgent
Ugly yet efficient public menu for en- and disabling easily.


removeAgentW

public javax.swing.JMenuItem removeAgentW
Ugly yet efficient public menu for en- and disabling easily.


removeAgent

public javax.swing.JMenuItem removeAgent
Ugly yet efficient public menu for en- and disabling easily.


placeAgent

public javax.swing.JMenuItem placeAgent
Ugly yet efficient public menu for en- and disabling easily.


externalAgent

public javax.swing.JMenuItem externalAgent
Ugly yet efficient public menu for en- and disabling easily.


world_new_map

public javax.swing.JMenuItem world_new_map
Ugly yet efficient public menu for en- and disabling easily.


world_load_map

public javax.swing.JMenuItem world_load_map
Ugly yet efficient public menu for en- and disabling easily.


world_load_world

public javax.swing.JMenuItem world_load_world
Ugly yet efficient public menu for en- and disabling easily.


world_edit_map

public javax.swing.JMenuItem world_edit_map
Ugly yet efficient public menu for en- and disabling easily.


world_save_world

public javax.swing.JMenuItem world_save_world
Ugly yet efficient public menu for en- and disabling easily.


sim_menu

public javax.swing.JMenu sim_menu
Ugly yet efficient public menu for en- and disabling easily.


sim_play

public javax.swing.JMenuItem sim_play
Ugly yet efficient public menu for en- and disabling easily.


sim_stop

public javax.swing.JMenuItem sim_stop
Ugly yet efficient public menu for en- and disabling easily.

Constructor Detail

RAGui

public RAGui()
Constructor.

Method Detail

getDockPanel

public javax.swing.JPanel getDockPanel()
Get the dock panel.

Specified by:
getDockPanel in class DockReceiver

getDockArea

public javax.swing.JPanel getDockArea()
Get the dock area.

Specified by:
getDockArea in class DockReceiver

showStarters

public static void showStarters()
Show the logo during startup.


hideStarters

public static void hideStarters()
Hide the logo after startup.


getCurrentGui

public static RAGui getCurrentGui()
Return current GUI instance.


close

public void close()
Close neatly.


newMap

public void newMap()
New map.


loadMap

public boolean loadMap()
Load a map.


loadMap

public boolean loadMap(java.io.File f,
                       boolean setLastPath)
Load a map.


editMap

public void editMap()
Edit a map.


updateMap

public void updateMap(java.lang.String worldDescription)
               throws RAException
Update a world.

Throws:
RAException

loadWorld

public void loadWorld()
Load a world.


loadWorld

public void loadWorld(java.io.File f)
               throws RAException
Load a world from a file.

Throws:
RAException

saveWorld

public void saveWorld()
Save a world.


saveWorld

public void saveWorld(java.io.File f)
               throws RAException
Save a world to a file.

Throws:
RAException

newAgent

public void newAgent()
New agent.


newAgent

public void newAgent(RAAgent a)
New agent.


loadAgent

public void loadAgent()
Load agent.


saveAgent

public void saveAgent(RAAgent a)
Save agent.


renameAgent

public void renameAgent(RAAgent aa)
Rename agent.


editAgent

public void editAgent(RAAgent aa)
Edit agent.


agentIsInWorld

public boolean agentIsInWorld(RAAgent a)
Is the agent specified in the world or not?


getWorldAgents

public java.util.Vector getWorldAgents()
Get the agents that are in the world.


removeAgentFromWorld

public void removeAgentFromWorld(RAAgent a)
Remove agent.


removeAgentCompletely

public void removeAgentCompletely(RAAgent a)
Remove agent.


place

public void place(RAAgent a)
           throws RAException
Add agent to world (command).

Throws:
RAException

addAgentToWorld

public void addAgentToWorld(RAAgent agent,
                            java.awt.geom.Point2D.Double position,
                            double rotation)
Add agent to world.


externalAgent

public void externalAgent(RAAgent a)
                   throws RAException
Add agent to the External Agents controls.

Throws:
RAException

showDebug

public void showDebug()
Show a debug and monitor window.


debug

public void debug(java.lang.Object toDebug)
Debug/show the object provided.


configurePlugins

public void configurePlugins()
Show plugin config.


generalSettings

public void generalSettings()
General settings.


help

public void help()
Show some help.


about

public void about()
Show some help.


determineSafeMode

public void determineSafeMode()
Adapt interface in case of unsafe mode.


safeMode

public boolean safeMode()
Is the program in safe mode, i.e. is there something running or not?


notifyAgentListChanged

public void notifyAgentListChanged()
Notify that agent list has changed.


notifySimFrameClosed

public void notifySimFrameClosed()
Notify that the simulator has been closed.


notifyExternalAgentFrameClosed

public void notifyExternalAgentFrameClosed()
Notify that the external agent frame has been closed.


refreshPlugins

public void refreshPlugins()
Refresh all plug-ins in potentially open windows.


isSimulatorEnabled

public boolean isSimulatorEnabled()
Is simulator enabled?


setSimulatorEnabled

public void setSimulatorEnabled(boolean enabled)
Ensure correct simulator enable/disable status.


isExternalEnabled

public boolean isExternalEnabled()
Is external enabled?


setExternalEnabled

public void setExternalEnabled(boolean enabled)
Ensure correct external enable/disable status.


stripFileName

public static java.io.File stripFileName(java.io.File f)
New 1.2 fix for bug that last folder accessed is no longer remembered if we store a file instead of a directory.